NEW=$1
OLD=`cat lastrev`
REV=testgen-r${NEW}
LOG=log-r${NEW}
# list changes
if [[ "$OLD" != "" ]]; then
    LASTREV=testgen-r${OLD}
    echo
    echo "----------------------------"
    ./getChanges.sh oldrevs/${LASTREV} $REV
    echo "----------------------------"
    echo
fi
# remove old code from google
find google -type f|egrep -v 'svn|ChangeLog|admin'|xargs rm
# add new code
cp -r ${REV}/* google
mv $REV oldrevs/
mv google/ChangeLog google/tmpCL
cat $LOG >> google/ChangeLog
cat google/tmpCL >> google/ChangeLog
rm google/tmpCL
mv $LOG oldlogs/
echo $NEW > lastrev
